statefiles: fix stale pio handling for !ubus
Currently, config.c:odhcpd_reload() will call:
set_config()
// the piodir is set here
set_interface()
config_parse_interface()
statefiles_read_prefix_information()
statefiles_setup_dirfd()
ubus_apply_network()
config_parse_interface()
statefiles_read_prefix_information()
This works when ubus is enabled, because of the extra call to
ubus_apply_network() which will read the pio file after the
dirfd has been set up.
However, it won't work when ubus isn't enabled since it'll
turn ubus_apply_network() into a noop.
Fix this by moving the statefiles_setup_dirfd() calls into
set_config(), i.e. setup the dirfds as soon as the relevant
cfg options have been read.
Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/333
Signed-off-by: Álvaro Fernández Rojas <[email protected]>